package com.jdrx.sw.sewage.service;

import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jdrx.sw.sewage.beans.dto.MedicineCategoryAddDTO;
import com.jdrx.sw.sewage.beans.entity.MedicineCategoryPO;
import com.jdrx.sw.sewage.beans.vo.MedicinePointOptionVO;
import com.jdrx.sw.sewage.dao.GatherDevPointDAO;
import com.jdrx.sw.sewage.dao.MedicineCategoryDAO;

@Service
public class MedicineCategoryService {
	@Autowired
	private MedicineCategoryDAO medicineCategoryDAO;
	@Autowired
	private GatherDevPointDAO gatherDevPointDAO;
	
	public void add(MedicineCategoryAddDTO dto) {
		MedicineCategoryPO po = new MedicineCategoryPO();
		BeanUtils.copyProperties(dto, po);
		medicineCategoryDAO.insert(po);
	}
	
	public List<MedicineCategoryPO> listAll() {
		return medicineCategoryDAO.listAll();
	}
	
	public List<MedicinePointOptionVO> pointOptions() {
		return gatherDevPointDAO.options();
	}
}